package pack0828;

import java.util.Objects;

public class Emp implements Comparable{
    private Integer empNo;
    private String ename;
    private String job;
    private Integer sal;

    public Emp(){

    }

    public Emp(Integer empNo, String ename, String job, Integer sal) {
        this.empNo = empNo;
        this.ename = ename;
        this.job = job;
        this.sal = sal;
    }

    public Integer getEmpNo() {
        return empNo;
    }

    public void setEmpNo(Integer empNo) {
        this.empNo = empNo;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public Integer getSal() {
        return sal;
    }

    public void setSal(Integer sal) {
        this.sal = sal;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "empNo=" + empNo +
                ", ename='" + ename + '\'' +
                ", job='" + job + '\'' +
                ", sal=" + sal +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        System.out.println("我被调用啦");
        int m = this.empNo;
        int y = ((Emp)o).empNo;
        return m==y;
    }

    @Override
    public int hashCode() {
        return empNo;
    }

    @Override
    public int compareTo(Object o) {
        return 0;
    }
}
